fix(formatter): keep inline comment cells together in ReplaceWithVAR - #1788
fix(formatter): keep inline comment cells together in ReplaceWithVAR#1788Sanjays2402 wants to merge 2 commits into
Conversation
Robot Framework tokenizes a single inline comment into one COMMENT token per data cell, and only the first cell starts with '#'. When ReplaceWithVAR moved a multi-cell comment above the generated VAR, it emitted one comment line per token, so every cell after the first lost its '#' and became an executable line - silently breaking the suite at runtime. Cells that do not start with '#' are now appended to the preceding comment, so the original comment stays on one line. Closes MarketSquare#1715
|
I didn't comment on the PR yet as there were CI failures. Will you check it? I can do it as well, at this point I'm familiar with typical issues for older versions of Robot we support (for example test use VAR which wasn't available in RF 5 etc). And thanks for the PR! |
|
Checked the failures — good instinct. The two failing jobs are the RF 5.* and 6.* builds, and it's the new Fixed in b82fb29: the test now skips via |
Closes #1715
Robot Framework tokenizes a single inline comment into one
COMMENTtoken per data cell, and only the first cell starts with#. WhenReplaceWithVARmoved a multi-cell comment above the generatedVAR, it emitted one comment line per token, so every cell after the first lost its#and became an executable line — silently breaking the suite at runtime.Cells that do not start with
#are now appended to the preceding comment, so the original comment stays on one line. Regression test added totests/formatter/formatters/ReplaceWithVAR/test_formatter.py(parametrized overCreate DictionaryandCreate List); it fails on master and passes with the fix, and the fulltests/formattersuite stays green.This change was prepared with AI assistance; the regression test was run locally and fails without the fix.